﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nb.Common.Ioc;

namespace Nb.Common.Logs
{
    public static class GenericLoggingExtensions
    {
        public static ILogger GetLogger<T>(this T thing, bool refectRuntimeType = false)
        {
            Type theType = refectRuntimeType ? thing.GetType() : typeof(T);
            var log = CoreServiceProvider.LocateService<ILoggerProvider>().GetLogger(theType);
            return log;
        }
    }
}
